package com.atxiaodei.springbootwebthymeleaf.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @ClassName MyMvcConfig
 * @Deacription TODO
 * @Author 王盟
 * @Date 2021/3/30 9:40
 * @Version 1.0
 **/
@Configuration
// @EnableWebMvc 这个注解标注着导入了一个类，DelegatingWebMvcConfiguration：从容器中获取所有的webmvcconfig
public class MyMvcConfig implements WebMvcConfigurer {

    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        // super.addViewControllers(registry);
        //浏览器发送 /atxiaodei 请求来到 success
        registry.addViewController("/atxiaodei").setViewName("test");
    }
}
